package cn.itcast.bos.base.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.itcast.bos.base.dao.CourierDao;
import cn.itcast.bos.base.dao.StandardDao;
import cn.itcast.bos.base.service.CourierService;
import cn.itcast.bos.domain.base.Courier;
import cn.itcast.bos.domain.base.Standard;

@Service
@Transactional(readOnly=false)
public class CourierServiceImpl implements CourierService {
	@Autowired
	private CourierDao courierDao;

	@Override
	public void addCourier(Courier courier) {
		// TODO Auto-generated method stub
		courierDao.save(courier);
	}

	@Override
	public Page<Courier> showCourier(Specification specification,Pageable pageable) {
		// TODO Auto-generated method stub
		return courierDao.findAll(specification, pageable);
	}

	@Override
	public void deleteCourier(Integer[] paras) {
		// TODO Auto-generated method stub
		for (int i = 0; i < paras.length; i++) {
			courierDao.deleteCourier(paras[i]);
		}
	}

	@Override
	public void RestoreCourier(Integer[] paras) {
		// TODO Auto-generated method stub
		for (int i = 0; i < paras.length; i++) {
			courierDao.RestoreCourier(paras[i]);
		}
	}
}
